<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>博客阅读</title>
    <link rel="stylesheet"
          href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.16.2/build/styles/default.min.css">
    <script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.16.2/build/highlight.min.js"></script>
</head>
<body>
<h1 th:text="${article.title}" ></h1>
<div th:text="${article.content}" id="content"></div>
<script th:src="@{/lib/layui/layui.js}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.7.0/marked.js" integrity="sha256-K7OfhKvtqBJ0+5ngAlWG+5sJrlwDOC4OCWj+nP7qOnw=" crossorigin="anonymous"></script>

<script>
    layui.use(['jquery', 'form','layer'], function () {
        var $ = layui.jquery;
        $('#content').html(marked($('#content').text()));
        // 代码高亮
        hljs.initHighlightingOnLoad();
    })
</script>

</body>
</html>